/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package system.general;

import java.io.File;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;

@ManagedBean(name = "path")
public class Path {

    public String getPathApp() {
        return ((ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext()).getRealPath("/");
    }

    public String getFacesPath() {
        return ((ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext()).getContextPath() + File.separatorChar;
    }

    public String getDocumentPathSave() {
        //return "/media" + File.separatorChar + "data" + File.separatorChar + "NetBeansProjects" + File.separatorChar + "document" + File.separatorChar;
        return File.separatorChar + "home" + File.separatorChar + "document" + File.separatorChar;
    }

    public String getPersonPath() {
        return getDocumentPathSave() + "person" + File.separatorChar;
    }

    public String getPersonPathView() {
        return ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + "person" + File.separatorChar;
    }

    public String getPerfilPath() {
        return getDocumentPathSave() + "perfil" + File.separatorChar;
    }

    public String getPerfilPathView() {
        return ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + "perfil" + File.separatorChar;
    }

    public String getRequestPath() {
        return getDocumentPathSave() + "request" + File.separatorChar;
    }

    public String getRequestPathView() {
        return ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + ".." + File.separatorChar + "request" + File.separatorChar;
    }

    public String getImagePathView() {
        return getFacesPath() + "document" + File.separatorChar + "image" + File.separatorChar;
    }

    public String getReportPathView() {
        return getPathApp() + "document" + File.separatorChar + "image" + File.separatorChar + "report" + File.separatorChar;
    }

    public String getLogoPathView() {
        return getPathApp() + "document" + File.separatorChar + "image" + File.separatorChar + "logo" + File.separatorChar;
    }

    public String getPersonReportPath() {
        return getPathApp() + "page" + File.separatorChar + "person" + File.separatorChar + "report" + File.separatorChar;
    }

    public String getRequestReportPath() {
        return getPathApp() + "page" + File.separatorChar + "request" + File.separatorChar + "report" + File.separatorChar;
    }

    public String getEvaluateReportPath() {
        return getPathApp() + "page" + File.separatorChar + "evaluate" + File.separatorChar + "report" + File.separatorChar;
    }

    public String getSupervisionPath() {
        return getDocumentPathSave() + "supervision" + File.separatorChar;
    }

    public String getSupervisionPathView() {
        return getFacesPath() + "document" + File.separatorChar + "supervision" + File.separatorChar;
    }

    public String getSupervisionReportPath() {
        return getPathApp() + "page" + File.separatorChar + "supervision" + File.separatorChar + "report" + File.separatorChar;
    }
}
